package org.alex.samples.service;

import java.util.List;

import org.alex.samples.dao.IExamSubjectDAO;
import org.alex.samples.model.ExamSubject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ExamSubjectServiceImpl  implements IExamSubjectService{
	
	@Autowired
	private IExamSubjectDAO examSubjectDAO;
	
	//查询全部科目
	@Override
	public List<ExamSubject> findAllExamSubject() {		
		return examSubjectDAO.findAllExamSubject();
	}

	//新增科目
	@Override
	public void createExamSubject(ExamSubject examSubject) throws Exception {
		examSubjectDAO.createExamSubject(examSubject);	
	}

	//删除科目
	@Override
	public void deleteExamSubject(Integer subId) throws Exception {
		examSubjectDAO.deleteExamSubject(subId);		
	}

	
	//修改科目
	@Override
	public void editExamSubject(ExamSubject examSubject) throws Exception {
		examSubjectDAO.editExamSubject(examSubject);		
	}

	//查询某个科目
	@Override
	public ExamSubject getExamSubjectById(Integer subId) {
		return examSubjectDAO.getExamSubjectById(subId);
	}
	
}
